* use hierarchy with cmake.
* adjust cmake test script for hierarchy.
the default target with cmake builds both the CLI and the GUI.
alternatively, "cmake --build . --target gpsbabel" to build just the
CLI or "cmake --build . --target GPSBabelFE|gpsbabelfe to build just
the GUI.
* detect attempts to generate a build system from a subdirectory.
* fix shellcheck issues.
- name: build_and_test
run: |
- ./build_and_test
+ ./tools/build_and_test.sh
- name: build_and_test
run: |
- ./build_and_test
+ ./tools/build_and_test.sh
cmake:
name: cmake Build
- name: build_and_test
run: |
- ./tools/build_and_test_cmake
+ ./tools/build_and_test_cmake.sh
qtio_gcc:
name: qtio gcc Build
- name: build_and_test
run: |
. /opt/qtio.env
- ./build_and_test
+ ./tools/build_and_test.sh
qtio_clang:
name: qtio clang Build
- name: build_and_test
run: |
. /opt/qtio.env
- ./build_and_test
+ ./tools/build_and_test.sh
advanced:
name: advanced Build
- name: build_extra_tests
run: |
- ./tools/build_extra_tests
+ ./tools/build_extra_tests.sh
coverage:
name: coverage Build
cmake_minimum_required(VERSION 3.11)
include(gbversion.cmake)
-configure_file(gbversion.h.in gbversion.h @ONLY NEWLINE_STYLE LF)
project(gpsbabel LANGUAGES C CXX VERSION ${GB.VERSION})
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
+# Do this after we set up common variables but before creating other
+# variables that will be inherited.
+add_subdirectory(gui)
+
+# FIXME: When we rearrange the project directory structure everything
+# below here should be in it's own CMakeList.txt
+
+configure_file(gbversion.h.in gbversion.h @ONLY NEWLINE_STYLE LF)
+
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Handle the Qt rcc code generator automatically
gbfile.h
gbser.h
gbser_private.h
- gbversion.h
geojson.h
ggv_bin.h
globalsat_sport.h
gbfile.h \
gbser.h \
gbser_private.h \
- gbversion.h \
geojson.h \
ggv_bin.h \
globalsat_sport.h \
+++ /dev/null
-#!/bin/bash -ex
-#
-# this script is triggered by SCM changes and is run on the build server.
-# output is conditionally mailed to gpsbabel-code.
-#
-# echo some system info to log
-uname -a
-if [ -e /etc/system-release ]; then
- cat /etc/system-release
-fi
-if [ -e /etc/os-release ]; then
- cat /etc/os-release
-fi
-git --no-pager log -n 1
-# build and test keeping output within the pwd.
-export GBTEMP=$(pwd)/gbtemp
-mkdir -p $GBTEMP
-qmake WEB=$(pwd)/gpsbabel_docdir
-# As of 2018-10, all the virtualized travis build images are two cores per:
-# https://docs.travis-ci.com/user/reference/overview/
-# We'll be slightly abusive on CPU knowing that I/O is virtualized.
-make toolinfo
-make clean
-make -j 3
-make -j 3 unix-gui
-make gpsbabel.html
-make gpsbabel.pdf
-make gpsbabel.org
-make check
-# test for mangled encoding of command line arguments
-./test_encoding_latin1
-./test_encoding_utf8
-#make torture
-make -k -j2 check-vtesto
-# eat the verbose output from test-all, including crash.output
-# this is a bit risky, if test-all generates an error we won't see what happened.
-echo "test-all in progress... (read/write test between all possible formats)"
-(LIBC_FATAL_STDERR_=1; export LIBC_FATAL_STDERR_; ./test-all -s -r reference/expertgps.gpx >/dev/null 2>&1)
-# summarize the test-all results, and generate an error if a fatal error was
-# detected by test-all.
-./test-all -J
# Use GB variable to express ownership intention and avoid conflict with
# documented and undocumented cmake variables.
-# Until we do a hierarchical build the build directory for gpsbabel and
-# the build directory for GPSBabelFE are independent. Only the source
-# directories have a known relationship. Including this pri file from the
-# source tree will generate the version file in the current build directory.
+# Including this pri file from ${CMAKE_SOURCE_DIR} will generate the version
+# file in the current build directory, i.e. ${CMAKE_CURRENT_BINARY_DIR}.
# Note some of these variables are also used in the gui to generate setup.iss.
# Note some of these variables are also used in the cli to generate documents.
-cmake_minimum_required(VERSION 3.11)
+if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
+ message(FATAL_ERROR "Please use CMakeLists.txt in the project root directory to generate a build system.")
+endif()
-include(../gbversion.cmake)
-configure_file(../gbversion.h.in gbversion.h @ONLY NEWLINE_STYLE LF)
+configure_file(${CMAKE_SOURCE_DIR}/gbversion.h.in gbversion.h @ONLY NEWLINE_STYLE LF)
configure_file(setup.iss.in setup.iss @ONLY NEWLINE_STYLE CRLF)
-project(gpsbabelfe LANGUAGES CXX VERSION ${GB.VERSION})
-
-set(CMAKE_CXX_STANDARD 17)
-set(CMAKE_CXX_STANDARD_REQUIRED True)
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
--- /dev/null
+#!/bin/bash -ex
+#
+# this script is triggered by SCM changes and is run on the build server.
+# output is conditionally mailed to gpsbabel-code.
+#
+# echo some system info to log
+uname -a
+if [ -e /etc/system-release ]; then
+ cat /etc/system-release
+fi
+if [ -e /etc/os-release ]; then
+ cat /etc/os-release
+fi
+git --no-pager log -n 1
+# build and test keeping output within the pwd.
+export GBTEMP=$(pwd)/gbtemp
+mkdir -p "$GBTEMP"
+qmake WEB="$(pwd)/gpsbabel_docdir"
+# As of 2018-10, all the virtualized travis build images are two cores per:
+# https://docs.travis-ci.com/user/reference/overview/
+# We'll be slightly abusive on CPU knowing that I/O is virtualized.
+make toolinfo
+make clean
+make -j 3
+make -j 3 unix-gui
+make gpsbabel.html
+make gpsbabel.pdf
+make gpsbabel.org
+make check
+# test for mangled encoding of command line arguments
+./test_encoding_latin1
+./test_encoding_utf8
+#make torture
+make -k -j2 check-vtesto
+# eat the verbose output from test-all, including crash.output
+# this is a bit risky, if test-all generates an error we won't see what happened.
+echo "test-all in progress... (read/write test between all possible formats)"
+(LIBC_FATAL_STDERR_=1; export LIBC_FATAL_STDERR_; ./test-all -s -r reference/expertgps.gpx >/dev/null 2>&1)
+# summarize the test-all results, and generate an error if a fatal error was
+# detected by test-all.
+./test-all -J
+++ /dev/null
-#!/bin/bash -ex
-#
-# this script is triggered by SCM changes and is run on the build server.
-# output is conditionally mailed to gpsbabel-code.
-#
-# echo some system info to log
-uname -a
-if [ -e /etc/system-release ]; then
- cat /etc/system-release
-fi
-if [ -e /etc/os-release ]; then
- cat /etc/os-release
-fi
-git --no-pager log -n 1
-# build and test keeping output within the pwd.
-export GBTEMP=$(pwd)/gbtemp
-mkdir -p $GBTEMP
-cmake . -G Ninja -DCMAKE_BUILD_TYPE=Release -DWEB=$(pwd)/gpsbabel_docdir
-# As of 2018-10, all the virtualized travis build images are two cores per:
-# https://docs.travis-ci.com/user/reference/overview/
-# We'll be slightly abusive on CPU knowing that I/O is virtualized.
-#make toolinfo
-cmake --build . --target clean
-cmake --build .
-cmake --build . --target gpsbabel.html
-cmake --build . --target gpsbabel.pdf
-cmake --build . --target gpsbabel.org
-cmake --build . --target check
-#make -j 3 unix-gui
-# FIXME: use hierarchical build
-pushd gui
-cmake . -G Ninja
-cmake --build .
-popd
-# test for mangled encoding of command line arguments
-./test_encoding_latin1
-./test_encoding_utf8
-#make torture
-cmake --build . --target check-vtesto
-# eat the verbose output from test-all, including crash.output
-# this is a bit risky, if test-all generates an error we won't see what happened.
-echo "test-all in progress... (read/write test between all possible formats)"
-(LIBC_FATAL_STDERR_=1; export LIBC_FATAL_STDERR_; ./test-all -s -r reference/expertgps.gpx >/dev/null 2>&1)
-# summarize the test-all results, and generate an error if a fatal error was
-# detected by test-all.
-./test-all -J
--- /dev/null
+#!/bin/bash -ex
+#
+# this script is triggered by SCM changes and is run on the build server.
+# output is conditionally mailed to gpsbabel-code.
+#
+# echo some system info to log
+uname -a
+if [ -e /etc/system-release ]; then
+ cat /etc/system-release
+fi
+if [ -e /etc/os-release ]; then
+ cat /etc/os-release
+fi
+git --no-pager log -n 1
+# build and test keeping output within the pwd.
+export GBTEMP=$(pwd)/gbtemp
+mkdir -p "$GBTEMP"
+cmake . -G Ninja -DCMAKE_BUILD_TYPE=Release -DWEB="$(pwd)/gpsbabel_docdir"
+# As of 2018-10, all the virtualized travis build images are two cores per:
+# https://docs.travis-ci.com/user/reference/overview/
+# We'll be slightly abusive on CPU knowing that I/O is virtualized.
+#make toolinfo
+cmake --build . --target clean
+cmake --build . --target gpsbabel
+cmake --build . --target gpsbabel.html
+cmake --build . --target gpsbabel.pdf
+cmake --build . --target gpsbabel.org
+cmake --build . --target check
+cmake --build . --target gpsbabelfe
+# test for mangled encoding of command line arguments
+./test_encoding_latin1
+./test_encoding_utf8
+#make torture
+cmake --build . --target check-vtesto
+# eat the verbose output from test-all, including crash.output
+# this is a bit risky, if test-all generates an error we won't see what happened.
+echo "test-all in progress... (read/write test between all possible formats)"
+(LIBC_FATAL_STDERR_=1; export LIBC_FATAL_STDERR_; ./test-all -s -r reference/expertgps.gpx >/dev/null 2>&1)
+# summarize the test-all results, and generate an error if a fatal error was
+# detected by test-all.
+./test-all -J
+++ /dev/null
-#!/bin/bash -ex
-#
-# this script is triggered by SCM changes and is run on the build server.
-# output is conditionally mailed to gpsbabel-code.
-#
-
-# echo some system info to log
-uname -a
-if [ -e /etc/system-release ]; then
- cat /etc/system-release
-fi
-if [ -e /etc/os-release ]; then
- cat /etc/os-release
-fi
-git --no-pager log -n 1
-
-# build and test keeping output within the pwd.
-export GBTEMP=$(mktemp -d -p $(pwd) GBTEMPXXXX)
-
-#note that debug will also enable assertions.
-qmake "CONFIG+=debug sanitizer sanitize_address"
-make clean
-make -j 3
-make check
-
-qmake "CONFIG+=debug sanitizer sanitize_undefined"
-make clean
-make -j 3
-make check
-
-export CLAZY_CHECKS=level0,level1,no-non-pod-global-static,no-qstring-ref
-qmake -spec linux-clang "CONFIG+=debug" "QMAKE_CXX=clazy"
-make clean
-make -j 3 2>&1 | tee clazy.log
-if grep -- '-Wclazy' clazy.log; then
- exit 1
-else
- exit 0
-fi
-
--- /dev/null
+#!/bin/bash -ex
+#
+# this script is triggered by SCM changes and is run on the build server.
+# output is conditionally mailed to gpsbabel-code.
+#
+
+# echo some system info to log
+uname -a
+if [ -e /etc/system-release ]; then
+ cat /etc/system-release
+fi
+if [ -e /etc/os-release ]; then
+ cat /etc/os-release
+fi
+git --no-pager log -n 1
+
+# build and test keeping output within the pwd.
+export GBTEMP=$(mktemp -d -p $(pwd) GBTEMPXXXX)
+
+#note that debug will also enable assertions.
+qmake "CONFIG+=debug sanitizer sanitize_address"
+make clean
+make -j 3
+make check
+
+qmake "CONFIG+=debug sanitizer sanitize_undefined"
+make clean
+make -j 3
+make check
+
+export CLAZY_CHECKS=level0,level1,no-non-pod-global-static,no-qstring-ref
+qmake -spec linux-clang "CONFIG+=debug" "QMAKE_CXX=clazy"
+make clean
+make -j 3 2>&1 | tee clazy.log
+if grep -- '-Wclazy' clazy.log; then
+ exit 1
+else
+ exit 0
+fi
+
Get-Item tools/make_windows_release.ps1 -ErrorAction Stop | Out-Null\r
$gpsbabel_src_dir = "$Pwd"\r
$gpsbabel_build_dir = "$($gpsbabel_src_dir)\..\$($gpsbabel_build_dir_name)"\r
-$gui_build_dir = "$($gpsbabel_src_dir)\$($gui_build_dir_name)"\r
+if ( "$flow" -eq "cmake" ) {\r
+ $gui_build_dir = "$($gpsbabel_build_dir)"\r
+} else {\r
+ $gui_build_dir = "$($gpsbabel_src_dir)\$($gui_build_dir_name)"\r
+}\r
if ( "$flow" -eq "msbuild" ) {\r
# translate target architecture to Platform property value.\r
switch ($arch) {\r
# copy GPSBabel.exe for use by test_script\r
Remove-Item "$($gpsbabel_src_dir)\release" -Recurse -ErrorAction Ignore\r
New-Item "$($gpsbabel_src_dir)\release" -type directory -Force | Out-Null\r
-Copy-Item release\GPSBabel.exe "$($gpsbabel_src_dir)\release\GPSBabel.exe"\r
-Set-Location "$($gpsbabel_src_dir)"\r
-# make sure we are staring with a clean build directory\r
-Remove-Item "$($gui_build_dir)" -Recurse -ErrorAction Ignore\r
-New-Item "$($gui_build_dir)" -type directory -Force | Out-Null\r
-Set-Location "$($gui_build_dir)"\r
-switch ($flow) {\r
- "mingw" { qmake "$($gpsbabel_src_dir)\gui\app.pro" -spec "win32-g++" }\r
- "msbuild" { qmake -tp vc "$($gpsbabel_src_dir)\gui\app.pro" }\r
- "nmake" { qmake "$($gpsbabel_src_dir)\gui\app.pro" -spec "win32-msvc" }\r
- "cmake" { cmake -G "Ninja" -DCMAKE_BUILD_TYPE:STRING:="Release" -DCMAKE_PREFIX_PATH:PATH="$($CMAKE_PREFIX_PATH)" -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH="$($gui_build_dir)\release" "$($gpsbabel_src_dir)\gui" }\r
-}\r
-if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }\r
-switch ($flow) {\r
- "mingw" { ming32-make }\r
- "msbuild" { msbuild GPSBabelFE.vcxproj -property:Configuration=Release -property:Platform=$platform }\r
- "nmake" { nmake /NOLOGO }\r
- "cmake" { cmake --build . }\r
+Copy-Item "$($gpsbabel_build_dir)\release\GPSBabel.exe" "$($gpsbabel_src_dir)\release\GPSBabel.exe"\r
+if ( "$flow" -ne "cmake" ) {\r
+ Set-Location "$($gpsbabel_src_dir)"\r
+ # make sure we are staring with a clean build directory\r
+ Remove-Item "$($gui_build_dir)" -Recurse -ErrorAction Ignore\r
+ New-Item "$($gui_build_dir)" -type directory -Force | Out-Null\r
+ Set-Location "$($gui_build_dir)"\r
+ switch ($flow) {\r
+ "mingw" { qmake "$($gpsbabel_src_dir)\gui\app.pro" -spec "win32-g++" }\r
+ "msbuild" { qmake -tp vc "$($gpsbabel_src_dir)\gui\app.pro" }\r
+ "nmake" { qmake "$($gpsbabel_src_dir)\gui\app.pro" -spec "win32-msvc" }\r
+ }\r
+ if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }\r
+ switch ($flow) {\r
+ "mingw" { ming32-make }\r
+ "msbuild" { msbuild GPSBabelFE.vcxproj -property:Configuration=Release -property:Platform=$platform }\r
+ "nmake" { nmake /NOLOGO }\r
+ }\r
+ if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }\r
}\r
-if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }\r
+Set-Location "$($gui_build_dir)"\r
# work around errors with lupdate, lrelease misprocessing qtHaveModule(webenginewidgets)\r
# and generating a message to stderr WARNING: Project ERROR: Unknown module(s) in QT: webkit webkitwidgets\r
# and, on Windows, setting $? to false.\r
& "$($windeployqt)" --verbose 1 --plugindir package\plugins package\GPSBabelFE.exe package\GPSBabel.exe\r
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }\r
if ($buildinstaller -eq "true") {\r
+ # set location to location of generated setup.iss file.\r
+ if ( "$flow" -eq "cmake" ) {\r
+ Set-Location "$($gpsbabel_build_dir)/gui"\r
+ }\r
& "$($iscc)" /Dpackage_dir="$($gui_build_dir)\package" /Dsource_dir="$($gpsbabel_src_dir)\gui" setup.iss\r
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }\r
}\r